#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<string>
#include<list>
using std::cout;
using std::cin;
using std::endl;

#include"list.h"

void testSTD()
{
	using std::list;
	list<int> lt;
	lt.push_back(1);
	lt.push_back(2);
	lt.push_back(3);
	lt.push_back(4);
	lt.push_back(5);
	cout << lt.size() << endl;
}
 
void test_mylist()
{
	list<int> lt;
	lt.push_back(1);
	lt.push_back(2);
	lt.push_back(3);
	lt.push_back(4);
	lt.push_back(5);

	for (auto e : lt)
		cout << e << " ";
	cout<< endl;

	list<int>::reverse_iterator it = lt.rbegin();
	while (it != lt.rend())
		cout << *it++ << " ";
	cout << endl;

	auto it0 = lt.begin();
	while (it0 != lt.end())
	{
		if (*it0 % 2 == 0)
			lt.insert(it0, *it0);
		++it0;
	}

	for (auto e : lt)
		cout << e << " ";
	cout << endl;

	cout << "size==" << lt.size() << endl;
}
int main() 
{
	test_mylist();
	return 0;
}